<template>
	<view>
		<block v-for="(item,index) in list" :key="index">
			<view class="cu-list menu card-menu margin-top">
				<view class="cu-item">
					<view class="content padding-tb-sm">
						<view class="text-bold">
							{{item.name}}
							<text class='cu-tag sm bg-blue radius' v-if="item.status.result == 'PASSED'">认证成功</text>
							<text class='cu-tag sm bg-red radius' v-else>认证失败</text>
						</view>
						<view class="text-sm">企业证件号：{{item.registerNo}}</view>
						<view class="text-sm">法人姓名：{{item.legalPerson}}</view>
						<view class="text-sm">法人身份证号：{{item.legalPersonId || '暂无'}}
							<navigator :url="'/pages/company/create?id='+item.id" class="fr cu-tag">编辑</navigator>
							<!-- <button @click="del(item)" class="fr cu-tag">删除</button> -->
						</view>
					</view>
				</view>
			</view>
		</block>
		<view class="padding">
			<navigator url="/pages/company/create" class="cu-btn block bg-blue margin-tb-sm lg">添加新企业</navigator>
		</view>
	</view>
</template>

<script>
	var that
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			that = this
			that.$u.post('index/company').then(res => {
				that.list = res
			})
		},
		methods: {
			del(e) {
				that.$u.post('index/company',{op:'del','name':e.name}).then(res => {
					console.log(res);
				})
			}
		}
	}
</script>

<style>

</style>
